#字符串操作练习，文件操作练习
#加法

a= '1'
b='2'
a+=b
print(a)
a='a'
b= '  b'
a+=b
print(a)

#查找（find）
hello= 'hello,world'
print(hello.find('w'))
print(hello.find(','))
print(hello.find('o'))
print(hello.replace('h','HH'))

date_time='2020-10-25 11:47:00'
print(date_time.split('5'))
rr='abc'
print(rr.join('567'))
#删掉空格
t=  '  dbs  dd'
print(t)
print(t.strip())#去掉字符串两边的空格，中间的不可以
print(t.rstrip())#right  右
print(t.lstrip())#left strip左
d = '(hdjj dash)'
print(d.strip(' '))
a= '2020-10-%s  %s   %s:%s' %(25,12,'a','1')
b= '2020-10,{1}.{2}  {2}'.format(1,'2',34)
b= '2020-10,{},{}{}'.format(1,2,3)#format,默认是依次排列进去
print(a,b,sep='\n')
people,mother=1,2
e= f'2020-{people}:..;{mother}'
print(e)


with open('第二周第二节作业你还没写',mode='rt',encoding='utf-8')as  job:
    with open('第二周第二节作业',mode='wt',encoding='utf-8')as  new_file:
        for i  in job:
            new_file.write(i)


